<!--  -->
<template>
<div class='competition-page'>
  <van-sticky>
    <c-title :hide="false" text="赛事报名"  ></c-title>
    <div class=" competition-head">
      <div class="flex-a-c">
        <!-- <div class="flex address">上海<div class="iconfont icon-icon_down1"></div></div> -->
        <div class="search-box">
          <van-search v-model="query.title" placeholder="请输入活动名称" shape="round" show-action @search="onSearch"  >
            <template #action>
              <div @click="onSearch">搜索</div>
            </template>
          </van-search>
        </div>
      </div>
      <div>
        <van-tabs 
          v-model="query.activity_status" color="var(--themeBaseColor)" title-active-color="var(--themeBaseColor)" title-inactive-color="#00001C" line-width="15px" @change="compentChange">
          <blcok v-for="(item,index) in tabArr" :key="index">
            <van-tab :title="item.name" :name="item.value"></van-tab>
          </blcok>
        </van-tabs>
      </div>
    </div>
  </van-sticky>
  
  <div class="competition-list" v-if="competitionArr.length > 0">
    <blcok v-for="(item,index) in competitionArr" :key="index">
      <competition-item :item="item"></competition-item>
    </blcok>
    
  </div> 
  <van-empty description="暂无相关活动" v-else />
  <div class="mh-50"></div> 
</div>
</template>

<script>
import competition_controller from './competition_controller';
export default competition_controller;
</script>
<style lang="scss" scoped>
  ::v-deep .van-tabs__line {
    bottom:1.25rem;
  }
  ::v-deep .van-button--normal {
    padding:0;
  }
  .mh-50 {
    height: 3.125rem;
    clear: both;
  }
/* @import url(); 引入公共css类 */
  .competition-head {
    background-color: #fff;
    width:100%;
    .address {
      width:15%;
      padding:0 0 0 0.75rem;
      box-sizing: border-box;
      font-weight: 400;
      font-size: 0.8125rem;
      color: #333333;
      .icon-icon_down1 {
        padding:0 0 0 0.3125rem;
        font-size: 0.75rem;
      }
    }
    .search-box {
      width:100%;
    }
  }
  .competition-list {
    margin:0.625rem 0.75rem 0 0.75rem;
  }
</style>